/**
 * @ author: 汪孟苹
 */
define(["jquery","bbcare","fu/app/comm/comm","scprit/followup/app/question/question.ui.js","fu/app/complaintRegister/complaintRegisterDetailData"],function($,$bb,$comm,$questionUi,$complaintRegisterDetailData){
	var complaintRegisterDetail = {};
	var URL = $bb.baseUrl("followup");
	complaintRegisterDetail.init = function(){
		var passParams = $bb.getPageParams();  // 从上个页面带过来的参数 实例id
		// 病人详情页的上部分
		if(passParams){
			var params = passParams.params;
			$complaintRegisterDetailData.reasonInit({
		        id: "complaintRegisterDetailInfo",
		        list: passParams.value,
		    });
		    oRowFollowup(params);
		}else{
			$toast.show("问卷加载失败！");
		}
	};
	function oRowFollowup(params){
		$bb.ajax({
			url: URL + "followup/service/patient/ptOnlineOprDetailQuery",
			data:JSON.stringify({
				data : params
			}),
			success: function(data){
				if(data.success){
	                $questionUi.init({
	                    id: "complaintRegisterDetail",
	                    list: data.data.questiones,	  // 问卷
	                    values: data.data.values,	// 问卷答案
	                    status: "readonly",
						showIcon: true
	                });
            	}else{
            		$toast.show(data.msg ? data.msg : "问卷加载失败！");
            	}
			}
		});
	}

	return complaintRegisterDetail;
});